Splits a path into the drive, directory, file name and file extension parts. An empty string is set if a part is missing.
#include <File.au3>
_PathSplit($szPath, ByRef $szDrive, ByRef $szDir, ByRef $szFName, ByRef $szExt)
Parameters
$szPath | The path to be split (Can contain a UNC server or drive letter) |
$szDrive | String to hold the drive |
$szDir | String to hold the directory |
$szFName | String to hold the file name |
$szExt | String to hold the file extension |
Return Value
Returns an array with 5 elements where 0 = original path, 1 = drive, 2 = directory, 3 = filename, 4 = extension
Remarks
None.
Related
_PathFull, _PathMake
Example
#include <file.au3>
#include <array.au3>
Dim $szDrive, $szDir, $szFName, $szExt
$TestPath = _PathSplit(@ScriptFullPath, $szDrive, $szDir, $szFName, $szExt)
_ArrayDisplay($TestPath,"Demo _PathSplit()")